home *** CD-ROM | disk | FTP | other *** search
- function FTraceAlertBoxClass()
- {
- this.init();
- }
- FTraceAlertBoxClass.prototype = new FDraggablePaneClass();
- FTraceAlertBoxClass.prototype.init = function()
- {
- this.attachMovie("ResizeBar_horizontal","resizeBar_horizontal_mc",this.level++,{controller:this});
- this.attachMovie("ResizeBar_vertical","resizeBar_vertical_mc",this.level++,{controller:this});
- this.resizeBar_vertical_mc.useHandCursor = false;
- this.resizeBar_vertical_mc.onPress = this.resizeTrackBegin_vertical;
- this.resizeBar_vertical_mc.onRelease = this.resizeTrackEnd;
- this.resizeBar_vertical_mc.onReleaseOutside = this.resizeTrackEnd;
- this.resizeBar_vertical_mc.onRollOver = this.setResizeCursor_vertical;
- this.resizeBar_vertical_mc.onRollOut = this.restoreCursor;
- this.resizeBar_horizontal_mc.useHandCursor = false;
- this.resizeBar_horizontal_mc.onPress = this.resizeTrackBegin_horizontal;
- this.resizeBar_horizontal_mc.onRelease = this.resizeTrackEnd;
- this.resizeBar_horizontal_mc.onReleaseOutside = this.resizeTrackEnd;
- this.resizeBar_horizontal_mc.onRollOver = this.setResizeCursor_horizontal;
- this.resizeBar_horizontal_mc.onRollOut = this.restoreCursor;
- this.traceText_fmt = new TextFormat();
- this.traceText_fmt.font = "Courier";
- this.createEmptyMovieClip("textHolder_mc",this.level++);
- this.textHolder_mc.createTextField("trace_txt",this.level++,0,0,100,20);
- this.textHolder_mc.trace_txt.type = "dynamic";
- this.textHolder_mc.trace_txt.multiline = true;
- this.textHolder_mc.trace_txt.wordWrap = true;
- this.textHolder_mc.trace_txt.embedFonts = false;
- this.textHolder_mc.trace_txt.autoSize = true;
- this.setScrollContent(this.textHolder_mc);
- super.init();
- this.resizeGrip_mc.useHandCursor = false;
- this.resizeCursor_mc.swapDepths(this.resizeBar_vertical_mc);
- _global.traceComponent = this;
- _global.traceAlert = function(msg)
- {
- if(!traceComponent.disableOnServer)
- {
- traceComponent.openPane(msg);
- }
- else if(_url.substr(0,4) != "http")
- {
- traceComponent.openPane(msg);
- }
- };
- this._visible = 0;
- };
- FTraceAlertBoxClass.prototype.setResizable = function(resizable)
- {
- super.setResizable(this.resizable);
- this.resizeBar_vertical_mc._visible = resizable;
- this.resizeBar_horizontal_mc._visible = resizable;
- };
- FTraceAlertBoxClass.prototype.setPaneSize = function(w, h)
- {
- var newWidth = w;
- var newHeight = h;
- if(newWidth == undefined)
- {
- newWidth = 240;
- }
- if(newHeight == undefined)
- {
- newHeight = 180;
- }
- if(this.maxWidth > 0 && newWidth > this.maxWidth)
- {
- newWidth = this.maxWidth;
- }
- if(this.minWidth > 0 && newWidth < this.minWidth)
- {
- newWidth = this.minWidth;
- }
- if(newWidth < this.defaultMinimumWidth())
- {
- newWidth = this.defaultMinimumWidth();
- }
- if(this.maxHeight > 0 && newHeight > this.maxHeight)
- {
- newHeight = this.maxHeight;
- }
- if(this.minHeight > 0 && newHeight < this.minHeight)
- {
- newHeight = this.minHeight;
- }
- if(newHeight < this.defaultShadedHeight() + this.resizeGrip_mc._height)
- {
- newHeight = this.defaultShadedHeight() + this.resizeGrip_mc._height;
- }
- if(this.isShaded)
- {
- this.normalWidth = newWidth;
- this.normalHeight = newHeight;
- newHeight = this.defaultShadedHeight();
- }
- this.setSize(newWidth,newHeight);
- };
- FTraceAlertBoxClass.prototype.shadePane = function()
- {
- super.shadePane();
- this.resizeBar_vertical_mc._visible = false;
- this.resizeBar_horizontal_mc._visible = false;
- this.textHolder_mc._visible = false;
- };
- FTraceAlertBoxClass.prototype.restorePane = function()
- {
- super.restorePane();
- this.resizeBar_vertical_mc._visible = true;
- this.resizeBar_horizontal_mc._visible = true;
- this.textHolder_mc._visible = true;
- };
- FTraceAlertBoxClass.prototype.setResizeCursor_horizontal = function()
- {
- this.controller.resizeCursor_mc.gotoAndStop(3);
- this.controller.resizeCursor_mc._x = this.controller._xmouse - this.controller.resizeCursor_mc._width / 2;
- this.controller.resizeCursor_mc._y = this.controller._ymouse - this.controller.resizeCursor_mc._height / 2;
- this.controller.resizeCursor_mc._visible = true;
- this.onMouseMove = this.controller.dragResizeCursor_horizontal;
- Mouse.hide();
- };
- FTraceAlertBoxClass.prototype.setResizeCursor_vertical = function()
- {
- this.controller.resizeCursor_mc.gotoAndStop(2);
- this.controller.resizeCursor_mc._x = this.controller._xmouse - this.controller.resizeCursor_mc._width / 2;
- this.controller.resizeCursor_mc._y = this.controller._ymouse - this.controller.resizeCursor_mc._height / 2;
- this.controller.resizeCursor_mc._visible = true;
- this.onMouseMove = this.controller.dragResizeCursor_vertical;
- Mouse.hide();
- };
- FTraceAlertBoxClass.prototype.dragResizeCursor_vertical = function()
- {
- this.controller.resizeCursor_mc._visible = true;
- this.controller.resizeCursor_mc._x = this.controller._xmouse - this.controller.resizeCursor_mc._width / 2;
- this.controller.resizeCursor_mc._y = this.controller._ymouse - this.controller.resizeCursor_mc._height / 2;
- };
- FTraceAlertBoxClass.prototype.dragResizeCursor_horizontal = function()
- {
- this.controller.resizeCursor_mc._visible = true;
- this.controller.resizeCursor_mc._x = this.controller._xmouse - this.controller.resizeCursor_mc._width / 2;
- this.controller.resizeCursor_mc._y = this.controller._ymouse - this.controller.resizeCursor_mc._height / 2;
- };
- FTraceAlertBoxClass.prototype.restoreCursor = function()
- {
- this.controller.resizeCursor_mc.gotoAndStop(1);
- this.controller.resizeCursor_mc._visible = false;
- this.onMouseMove = null;
- Mouse.show();
- };
- FTraceAlertBoxClass.prototype.formatFrame = function(x, y, w, h)
- {
- super.formatFrame(x,y,w,h);
- var titleHeight = this.getTitlebarHeight();
- var widgetSpacer = 2;
- var thisWidth = w;
- var thisHeight = h;
- this.resizeBar_vertical_mc._y = titleHeight + 1;
- this.resizeBar_vertical_mc._x = thisWidth - this.resizeBar_vertical_mc._width / 2;
- this.resizeBar_vertical_mc._height = thisHeight - (titleHeight + 1) - 16;
- this.resizeBar_horizontal_mc._x = 0;
- this.resizeBar_horizontal_mc._y = thisHeight - this.resizeBar_horizontal_mc._height / 2;
- this.resizeBar_horizontal_mc._width = thisWidth - 16;
- this.textHolder_mc._x = 0;
- this.textHolder_mc._y = titleHeight + 1;
- };
- FTraceAlertBoxClass.prototype.resizeTrackBegin = function()
- {
- Mouse.hide();
- this.controller.resizeCursor_mc._visible = true;
- this.anchorX = this._xmouse;
- this.anchorY = this._ymouse;
- this.onMouseMove = function()
- {
- this.controller.dragResizeCursor();
- var newWidth = this.controller.width + (this._xmouse - this.anchorX);
- var newHeight = this.controller.height + (this._ymouse - this.anchorY);
- if(newHeight < this.controller.defaultMinimumHeight())
- {
- newHeight = this.controller.defaultMinimumHeight();
- }
- this.controller.setPaneSize(newWidth,newHeight);
- this.controller.scrollpane_mc.setScrollPosition(0,newHeight);
- };
- };
- FTraceAlertBoxClass.prototype.resizeTrackBegin_vertical = function()
- {
- Mouse.hide();
- this.controller.resizeCursor_mc._visible = true;
- this.anchorX = this._xmouse;
- this.onMouseMove = function()
- {
- this.controller.dragResizeCursor();
- var newWidth = this.controller.width + (this._xmouse - this.anchorX);
- this.controller.setPaneSize(newWidth,this.controller.height);
- this.controller.scrollpane_mc.setScrollPosition(0,this._height);
- };
- };
- FTraceAlertBoxClass.prototype.resizeTrackBegin_horizontal = function()
- {
- Mouse.hide();
- this.controller.resizeCursor_mc._visible = true;
- this.anchorY = this._ymouse;
- this.onMouseMove = function()
- {
- this.controller.dragResizeCursor();
- var newHeight = this.controller.height + (this._ymouse - this.anchorY);
- if(newHeight < this.controller.defaultMinimumHeight())
- {
- newHeight = this.controller.defaultMinimumHeight();
- }
- this.controller.setPaneSize(this.controller.width,newHeight);
- this.controller.scrollpane_mc.setScrollPosition(0,newHeight);
- };
- };
- FDraggablePaneClass.prototype.titleTrackEnd = function(x, y)
- {
- this.controller.stopDrag();
- this.controller.preserveNormals();
- };
- FTraceAlertBoxClass.prototype.formatTitle = function(closeBoxOffset)
- {
- var txtS = this.textStyle;
- var sTbl = this.styleTable;
- txtS.align = sTbl.textAlign.value != undefined ? undefined : (txtS.align = "left");
- txtS.leftMargin = sTbl.textLeftMargin.value != undefined ? undefined : (txtS.leftMargin = 0);
- txtS.rightMargin = sTbl.textRightMargin.value != undefined ? undefined : (txtS.rightMargin = 0);
- txtS.leading = 0;
- this.titleText_mc.labelField.setTextFormat(txtS);
- var textWidth = this.titleText_mc.labelField.textWidth;
- var textHeight = this.titleText_mc.labelField.textHeight;
- this.titleText_mc._y = this.titleArea_mc._y + (this.titleArea_mc._height - textHeight) / 2 - 2;
- if(this.textStyle.align == "center")
- {
- this.titleText_mc._x = this.titleArea_mc._x + (this.titleArea_mc._width - textWidth) / 2;
- }
- else if(this.textStyle.align == "left")
- {
- if(this.hasShader == false)
- {
- this.titleText_mc._x = this.titleArea_mc._x;
- }
- else
- {
- this.titleText_mc._x = this.titleArea_mc._x + this.shader_mc._x + this.shader_mc._width;
- }
- }
- else if(this.textStyle.align == "right")
- {
- this.titleText_mc._x = closeBoxOffset - this.titleText_mc._width;
- }
- if(this.titleText_mc._x + this.titleText_mc._width > closeBoxOffset)
- {
- this.titleText_mc._x = closeBoxOffset - this.titleText_mc._width;
- }
- };
- FTraceAlertBoxClass.prototype.openPane = function(traceMessage)
- {
- this.traceMessage += traceMessage;
- this.traceMessage += "\n";
- if(!this._visible)
- {
- this._visible = true;
- }
- var tt = this.traceText_fmt.getTextExtent(this.traceMessage);
- this.textHolder_mc.trace_txt._width = tt.width;
- this.textHolder_mc.trace_txt.text = this.traceMessage;
- this.textHolder_mc.trace_txt.setTextFormat(this.traceText_fmt);
- this.textHolder_mc.trace_txt._width = this.textHolder_mc.trace_txt.textWidth + 7;
- this.textHolder_mc.trace_txt._height = this.textHolder_mc.trace_txt.textHeight + 7;
- this.setScrollContent(this.textHolder_mc);
- this.controller.scrollpane_mc.setScrollPosition(0,this._height);
- };
- FTraceAlertBoxClass.prototype.closePane = function()
- {
- if(this.closeHandler())
- {
- this.traceMessage = "";
- this._visible = false;
- }
- };
- Object.registerClass("FTraceAlertBoxSymbol",FTraceAlertBoxClass);
-